home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- Weapon Kick Jump
- -- Original Carnage Contest Weapon
- -- Script by DC, November 2009, www.UnrealSoftware.de
- --------------------------------------------------------------------------------
-
- -- Setup Tables
- if cc==nil then cc={} end
- cc.kickjump={}
-
- -- Load & Prepare Ressources
- cc.kickjump.gfx_wpn=loadgfx("weapons/kickjump.png") -- Weapon Image
- setmidhandle(cc.kickjump.gfx_wpn)
- cc.kickjump.sfx_kickjump=loadsfx("swish.ogg") -- Sound
-
- --------------------------------------------------------------------------------
- -- Weapon: Kick Jump
- --------------------------------------------------------------------------------
-
- cc.kickjump.id=addweapon("cc.kickjump","Kick Jump",cc.kickjump.gfx_wpn,0,2) -- Add Weapon (0 uses, first in round 2)
- cc.kickjump.ammo=1 -- 1 Kick Jump
-
- function cc.kickjump.draw() -- Draw
- if cc.kickjump.ammo-weapon_shots>0 then
- -- HUD Crosshair
- hudcrosshair(6,3)
- end
- end
-
- function cc.kickjump.attack(attack) -- Attack
- if weapon_timer>0 then
- weapon_timer=weapon_timer-1
- end
- if (weapon_shots<cc.kickjump.ammo) and (attack==1) and (weapon_timer<=0) then
- -- Use weapon and allow to use another one afterwards (1)
- useweapon(1)
- weapon_shots=weapon_shots+1
- weapon_timer=20
- -- FX
- playsound(cc.kickjump.sfx_kickjump)
- particle(p_muzzle,getplayerx(0),getplayery(0))
- particlesize(1,1)
- particlecolor(255,50,0)
- particlealpha(0.5)
- particlefadealpha(0.03)
- -- Push (absolute, push others!)
- playerpush(0,math.sin(math.rad(getplayerrotation(0)))*7.0,-math.cos(math.rad(getplayerrotation(0)))*7.0,1,1)
- end
- if weapon_shots>0 then
- -- Avoid Falldamage
- if getplayeryspeed(0)>7.0 then
- playerpush(0,getplayerxspeed(0),7.0,1,0)
- end
- end
- end